Expand description
A UncToken
type to represent a value of Near.
Each UncTokens
is composed of a floating point number of tokens where each integer unit is equal to one atto-Near.
UncToken
is implementing the common trait FromStr
. Also, have utils function to parse from str
into u128
.
§Examples
use unc_token::UncToken;
let one_unc = UncToken::from_attounc(10_u128.pow(24));
assert_eq!(one_unc, UncToken::from_unc(1));
assert_eq!(one_unc, UncToken::from_milliunc(1000));
§Crate features
-
borsh (optional) - When enabled allows
UncToken
to serialized and deserialized byborsh
. -
serde (optional) - When enabled allows
UncToken
to serialized and deserialized byserde
. -
schemars (optional) - Implements
schemars::JsonSchema
forUncToken
. -
interactive-clap (optional) - Implements
interactive_clap::ToCli
forUncToken
.